﻿#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int qh(int m)
{
	if (m <= 9)
		return m;
	else
		return m % 10 + qh(m / 10);
}

int main()
{
	int m = 0;
	printf("请输入需要求每位之和的数：");
	scanf("%d", &m);
	int i = qh(m);
	printf("%d", i);
	return 0;
}